<?php get_header();

$gallery_settings = get_option('wpnukes_gallery_settings');

$sidebar = ($_webnukes->kvalue($gallery_settings, 'sidebar') == 'active' ) ? true : false;

if( ! is_a($wpnukes, 'wpnukes_gallery') && class_exists('wpnukes_gallery')) $wpnukes = new wpnukes_gallery; ?>

<div class="container">

	<!--Page Banner-->
	<?php fw_subpages_banner('gallery'); /** Show Subpages banner */ ?>
	
	<!--breadcrumbs -->
	<div class="breadcrumbs">
		<?php echo get_the_breadcrumb(); /** add breadcrumbs */?>
	</div>
	
	<!-- Content Area-->
	<?php if($sidebar):?>
	<div id="contents_area">
		<div class="contents">
			<?php endif;?>
			
			<?php wpnukes_gallery_header(false);?>
			
			<div class="<?php echo ($sidebar) ? 'gallery_area_content' : 'gallery_area_full';?>">
			
				<?php if(have_posts() && $wpnukes ) : while (have_posts()) : the_post();?>
				<?php $wpnukes->gallery_html(array('container'=>'ul', 'thumb_size'=>'gallery-image1', 'title_limit'=>$_webnukes->kvalue($gallery_settings, 'title_limit', 25), 'content_limit'=>$_webnukes->kvalue($gallery_settings, 'content_limit', 200), 'images_per_page'=> 0)); ?>
				<?php endwhile;
				else:?>
				
				<div class="gallery_box_single">
					<p class="not_found">
						<?php _e('Sorry - nothing to display.', THEME_NAME); ?>
					</p>
				</div>
				<?php endif;?>
				
				<div class="pagination"></div>
			</div>
			
	<?php if($sidebar):?>
		</div>
	</div>
	<?php endif;?>
	
	<?php if($_webnukes->kvalue($gallery_settings, 'album_on_category') == 'active' && ! $sidebar): ?>
	<div class="container">
		<div id="more-galleries">
			<h2 class="blue"><?php _e('More Galleries', THEME_NAME);?></h2>
			<div id="popup" class="popup"></div>
			<div id="subgalleries">
				<?php $wpnukes->gallery_albums('thumbnail'); ?>
			</div>
		</div>
	</div>
	<?php endif;?>
	
	<?php if($sidebar):?>
	<div id="side_bar">
		<?php _load_dynamic_sidebar('gallery', 'blog-sidebar'); /** Display widgetize sidebar */ ?>
	</div>
	<?php endif;?>
	
</div>
<?php get_footer();?>